Repository navigation
fix(lua): a float shown during a question gives the keyboard back to it - #209
Conversation
Showing a float's overlay takes the keyboard. Outside a question riptide hands it back to the tab, but during one it handed it to nothing, so the keys went to the float and the question could no longer be typed into, e.g. a password manager's master password while its status float appeared. The status bar, which takes a question's keys, now gets them back. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
joshzcold
left a comment
There was a problem hiding this comment.
Reviewed the diff against shell::focus_for_prompt. Looks good to merge; one optional nit.
Fix (float.rs): correct. It gives the keyboard back the same way focus_for_prompt does:
- Same mode set (
Prompt | YesNo, as inshell.rs:812). - Same target (
s.statusbar); the bar is already focusable at that point, since entering the prompt set it. - The early
if !shown { return; }also saves theshell::withcall on every resize where nothing was newly shown.
A float with its own keys can't take keys while a question is open, since they reach it through the tab. That's the right priority: the question wins.
Test: good to drive real X keys, since the test channel skips focus. The wait_mode("prompt"), then float, then placed ordering avoids the obvious race. xdotool is already installed in check.yml's e2e job.
Nit: the two Command::new("xdotool") blocks could be one call, since xdotool chains commands: xdotool type --delay 20 hunter2 key Return. Or use a small closure, as input_settings.rs does.
I didn't run the e2e test locally; I'm relying on the author's run and CI.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Summary
set_visible(1)infloat::reposition) takes the keyboard. Outside a question riptide hands it back to the tab; during one (#84c222a) it handed it to nothing, so keys went to the float and the question couldn't be typed into.shell::focus_for_prompt).Testing
a_float_shown_during_a_question_leaves_it_the_keyboardtypes real X keys withxdotool(the test channel skips focus): it times out in prompt mode without the fix and passes with it.lua_events,pluginsandwindow_settingse2e suites pass (42 tests);cargo fmt --checkand clippy are clean.